package com.yshow.common.utils;

import org.apache.http.HttpStatus;

/**
 * @program: trunk
 * @description: 常见响应代码
 * @author: lilong
 * @create 2018-07-19 12:37
 **/
public enum ResponseCode {

    SUCCESS(HttpStatus.SC_OK, "OK"), // 成功
    ERROR(HttpStatus.SC_INTERNAL_SERVER_ERROR, "INNER_ERROR"), // 内部异常
    NEED_LOGIN(HttpStatus.SC_UNAUTHORIZED, "NEED_LOGIN"), // 需要登录
    ILLEGAL_ARGUMENT(HttpStatus.SC_FORBIDDEN, "HAS_NO_PERMISSION"); // 无权限

    private final int code;
    private final String desc;

    ResponseCode(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc(){
        return desc;
    }

}
